package com.sds.book.springcloud.sentinel.handler;

import com.alibaba.csp.sentinel.adapter.servlet.callback.UrlCleaner;
import org.springframework.util.StringUtils;

/**
 * 聚合 url
 *
 * @author 01420175
 * @since 2024/3/21
 */
public class CustomUrlCleaner implements UrlCleaner {
    @Override
    public String clean(String originUrl) {
        if (StringUtils.isEmpty(originUrl)) {
            return originUrl;
        }
        if (originUrl.startsWith("/clean/")) {
            return "/clean/*";
        }
        return originUrl;
    }

}
